<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,user-scalable=no"name="viewport">
<title>我的贡献</title>
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/business/style/base.css" />
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/business/style/style.css" />
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/business/style/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/business/style/mui.min.css">
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/business/style/app.css" />
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/business/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/business/js/bootstrap.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/business/js/script.js"></script>
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/business/js/mui.min.js"></script>
<style>
.mui-content #pullrefresh{width:100%;max-width:640px;margin:50px auto;}
</style>
</head>
<body>
<div id="box">
 <div class="navbar navbar-default navbar-fixed-top">
  <header>
   <h1><a href="index.html"><span class="glyphicon glyphicon-menu-left"></span></a></h1>
   <p class="title"><input type="text" placeholder="搜索会员账号/昵称" class="dealSeek"></p>
   <h6><img src="{:C('WEB_URL')}Public/business/images/manage_03.jpg" /></h6>
  </header>
 </div><!--navbar-fixed-top-->
  <div class="mui-content">
  	<div id="slider" class="mui-slider mui-fullscreen" style="width:100%;max-width:640px;margin:0 auto">
 <!--下拉刷新容器-->
 <div id="pullrefresh" class="mui-content mui-scroll-wrapper">
  <div class="mui-scroll details">
   <h4>累计交易次数：{$list1}次</h4>
   <!--数据列表-->
   <ul class="mui-table-view mui-table-view-chevron" id="contentop">
	<volist name="list" id="vo">
	<li class="action">
	  <div class="detail">
       <p>{$vo.time}</p>
       <div class="detLeft">
   	    <img src="{:C('WEB_URL')}Public/business/images/member_03.jpg" />
       </div><!--detLeft-->
       <div class="detCenter">
   	    <p class="detName">{$vo.name}</p>
   	    <p>NO.{$vo.user_id}</p>
       </div><!--detCenter-->
       <div class="detRight">
   	    <p>¥：{$vo.used_money}</p>
       </div><!--detRight-->
      </div><!--detail-->
     </li>
	</volist>
   </ul>
  </div><!--mui-scroll-->
 </div><!-- pullrefresh-->


</div><!--box-->
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/business/js/mui.min.js"></script>
<script type="text/javascript">
			mui.init({
				pullRefresh: {
					container: '#pullrefresh',
					down: {
						callback: pulldownRefresh
					},
					up: {
						contentrefresh: '正在加载...',
						callback: pullupRefresh
					}
				}
			});
			/**
			 * 下拉刷新具体业务实现
			 */
			function pulldownRefresh() {
				setTimeout(function() {
					var table = document.body.querySelector('.mui-table-view');
					var cells = document.body.querySelectorAll('.mui-table-view-cell');
					for (var i = cells.length, len = i + 3; i < len; i++) {
						var li = document.createElement('li');
						window.location.reload();
						//下拉刷新，新纪录插到最前面；
						table.insertBefore(li, table.firstChild);
					}
					mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
				}, 1500);
			}
			var count = 0;
			/**
			 * 上拉加载具体业务实现
			 */
			function pullupRefresh() {
				setTimeout(function() {
					mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
					var table = document.body.querySelector('.mui-table-view');
					var cells = document.body.querySelectorAll('.mui-table-view-cell');
					var nums=document.getElementById("contentop").children.length;
					$.ajax({
						  type:'POST',
						  url:'employeeRefresh_detailss',
						  dataType: "json",
						  data: 'limit='+nums,
						  success:function(data){
						
							$.each(data, function(index, item){
								console.log(item);
								var li = document.createElement('li');

								li.className = 'action';
								
								li.innerHTML = '<div class="detail"><p>'+item.time +'</p><div class="detLeft"><img src="{:C('WEB_URL')}Public/business/images/member_03.jpg" /></div><div class="detCenter"><p class="detName">'+item.name+'</p><p>NO.'+item.user_id+'</p></div><div class="detRight"><p>¥：'+item.used_money+'</p></div></div>';
								
								table.appendChild(li);
                             
                         });
						
						
						  	}
						 })
				}, 1500);
			}
			if (mui.os.plus) {
				mui.plusReady(function() {
					setTimeout(function() {
						mui('#pullrefresh').pullRefresh().pullupLoading();
					}, 1000);

				});
			} else {
				mui.ready(function() {
					mui('#pullrefresh').pullRefresh().pullupLoading();
				});
			}
		</script>
	</body>

</html>